package ar.com.photo_admin.domain.price_strategies

import ar.com.photo_admin.domain.PurchaseOrder

import ar.com.photo_admin.domain.*

class PriceStrategy {
	
	Photographer photographer
	
	static belongsTo = [photographer : Photographer]
	
	Float calculatePrice(PurchaseOrder purchaseOrder) {
		Float price = 0.0f
		
		purchaseOrder.orderItems.each {
			PhotoPrice priceDesc= purchaseOrder.photographer.pricesConfiguration.findBySize(it.size)
			price += (priceDesc.price) * it.amountCopies
		}
		return price
	}
	
	def representsADiscount(){
		return false	
	}
	
	String toString(){
		return "Sin promociones"
	}
}
